﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="XY_add_select_course.aspx.cs" Inherits="XY_add_select_course" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>学院添加学生选课信息</title>
    <style type="text/css">
        .auto-style1 {
            width: 100%;
        }
        .auto-style2 {
            text-align: center;
        }
        .auto-style3 {
            font-size: large;
        }
        .auto-style4 {
            font-weight: 700;
            font-size: large;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <table align="center" class="auto-style1">
            <tr>
                <td>
                    <div class="auto-style2">
                        <span class="auto-style3"><strong>选择学生：</strong></span><br />
                    </div>
                    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="Sno" DataSourceID="SqlDataSource1" ForeColor="#333333" GridLines="None" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:CommandField ShowSelectButton="True" />
                            <asp:BoundField DataField="Sno" HeaderText="Sno" ReadOnly="True" SortExpression="Sno" />
                            <asp:BoundField DataField="Sname" HeaderText="Sname" SortExpression="Sname" />
                            <asp:BoundField DataField="Sclass" HeaderText="Sclass" SortExpression="Sclass" />
                            <asp:BoundField DataField="Smajor" HeaderText="Smajor" SortExpression="Smajor" />
                            <asp:BoundField DataField="flag_register" HeaderText="flag_register" SortExpression="flag_register" />
                            <asp:BoundField DataField="flag_rest" HeaderText="flag_rest" SortExpression="flag_rest" />
                            <asp:BoundField DataField="flag_quit" HeaderText="flag_quit" SortExpression="flag_quit" />
                        </Columns>
                        <EditRowStyle BackColor="#7C6F57" />
                        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#E3EAEB" />
                        <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#F8FAFA" />
                        <SortedAscendingHeaderStyle BackColor="#246B61" />
                        <SortedDescendingCellStyle BackColor="#D4DFE1" />
                        <SortedDescendingHeaderStyle BackColor="#15524A" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:XSXKConnectionString4 %>" SelectCommand="SELECT [Sno], [Sname], [Sclass], [Smajor], [flag_register], [flag_rest], [flag_quit] 
FROM [Student]
where Student.Smajor=@major">
                        <SelectParameters>
                            <asp:SessionParameter Name="major" SessionField="dept" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
                <td>
                    <div class="auto-style2">
                        <span class="auto-style3"><strong>选择课程：</strong></span><br />
                    </div>
                    <asp:GridView ID="GridView2" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" DataKeyNames="Cno" DataSourceID="SqlDataSource2" ForeColor="#333333" GridLines="None" OnSelectedIndexChanged="GridView2_SelectedIndexChanged">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:CommandField ShowSelectButton="True" />
                            <asp:BoundField DataField="Cno" HeaderText="Cno" ReadOnly="True" SortExpression="Cno" />
                            <asp:BoundField DataField="Cname" HeaderText="Cname" SortExpression="Cname" />
                            <asp:BoundField DataField="category" HeaderText="category" SortExpression="category" />
                            <asp:BoundField DataField="credit" HeaderText="credit" SortExpression="credit" />
                            <asp:BoundField DataField="priority_no" HeaderText="priority_no" SortExpression="priority_no" />
                            <asp:BoundField DataField="major" HeaderText="major" SortExpression="major" />
                        </Columns>
                        <EditRowStyle BackColor="#7C6F57" />
                        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#E3EAEB" />
                        <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#F8FAFA" />
                        <SortedAscendingHeaderStyle BackColor="#246B61" />
                        <SortedDescendingCellStyle BackColor="#D4DFE1" />
                        <SortedDescendingHeaderStyle BackColor="#15524A" />
                    </asp:GridView>
                    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:XSXKConnectionString4 %>" SelectCommand="SELECT [Cno], [Cname], [category], [credit], [priority_no], [major] 
FROM [Course]
where Course.major=@major">
                        <SelectParameters>
                            <asp:SessionParameter Name="major" SessionField="dept" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                </td>
            </tr>
            <tr>
                <td class="auto-style2" colspan="2"><span class="auto-style3">学生学号：</span><asp:TextBox ID="TextBox1" runat="server" CssClass="auto-style3"></asp:TextBox>
                    <br class="auto-style3" />
                    <span class="auto-style3">学生：</span><asp:TextBox ID="TextBox2" runat="server" CssClass="auto-style3"></asp:TextBox>
                    <br class="auto-style3" />
                    <span class="auto-style3">课程号：</span><asp:TextBox ID="TextBox3" runat="server" CssClass="auto-style3"></asp:TextBox>
                    <br class="auto-style3" />
                    <span class="auto-style3">课程名：</span><asp:TextBox ID="TextBox4" runat="server" CssClass="auto-style3"></asp:TextBox>
                    <br />
                    <asp:Button ID="Button1" runat="server" CssClass="auto-style4" OnClick="Button1_Click" Text="确认选课" />
                </td>
            </tr>
        </table>
    
    </div>
    </form>
</body>
</html>
